<?php
class Http_Google_Data
{
	protected $_object;
	protected $_response;
	protected $_keyword;
	protected $_method;
	
	public function __construct($_keyword,$_method='')
	{
		$this->_keyword = $_keyword;
		$this->_method = $_method;
		self::_prepare();
		
		return $this;
	}
	
	private function _prepare()
	{
		Zend_Loader::loadClass('Mivec_Http_Google_Data');
		$this->_object = new Mivec_Http_Google_Data($this->_keyword,$this->_method);
		$this->_response = $this->_object->request()->get();
	}
	
	public function get()
	{
		return $this->_response;
	}
	
	public function getResultCount()
	{
		$_content = $this->_response;
		//print_r($_content);exit;
		if ($_content) {
			$_pattern->cc = "/<div id=resultStats>(\d+).*?<\/nobr>/is";
			preg_match($_pattern->cc,$_content,$_cc);
			if (is_numeric($_cc[1]))
				return $_cc[1];
		}
		return 0;
	}
	
	public function getCacheTime()
	{
		
	}
}